﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OrderCount.aspx.cs" Inherits="NJL.WebManage.Orders.OrderCount" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <style type="text/css" id="style1">
        table
        {
            border-collapse: collapse;
        }
        .reportTop
        {
            padding: 5px 16px;
            line-height: 35px;
        }
        .reportTop span
        {
            font-size: 14px;
        }
        .reportEnd
        {
            margin: 20px auto;
            line-height: 18px;
            font-size: 12px;
        }
        .reportEnd p
        {
            padding-left: 8px;
            line-height: 18px;
            margin: 0;
        }
        .reportEnd p span
        {
            margin-left: 15px;
        }
        .reportEnd span
        {
            padding-right: 8px;
        }
        .reporttit
        {
            margin: 20px 0;
            text-align: center;
        }
        .reporttit h1
        {
            font-size: 20px;
            font-weight: 700;
            margin: 5px 0;
            line-height: 40px;
        }
        .reporttit p
        {
            line-height: 20px;
            font-size: 14px;
        }
        .reporttit p span
        {
            margin: 0 10px;
        }
        .inforep
        {
            line-height: 25px;
            font-size: 13px;
            padding: 0 8px;
            margin: 0;
        }
        .reportTab
        {
            border: 1px solid #c7d2e3;
        }
        .reportTab caption
        {
            line-height: 35px;
            font-size: 16px;
            font-weight: 700;
        }
        .reportTab th
        {
            font-size: 14px;
            font-weight: 700;
            padding: 6px;
            background: #d4e3f9;
            border: 1px solid #c7d2e3;
        }
        .reportTab td
        {
            text-align: center;
            padding: 5px;
            border: 1px solid #c7d2e3;
        }
        .reportTab tfoot
        {
            background: #eef5ff;
        }
        .summary
        {
            text-align: right;
        }
        .summary span
        {
            margin: 0 12px;
        }
        .f_right
        {
            float: right;
        }
    </style>
    <script src="/Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="/Scripts/js/jquery.skygqbox.1.3.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" src="/Scripts/DatePicker/WdatePicker.js"></script>
    <script language="javascript" src="/Scripts/Printer/LodopFuncs.js"></script>
    <object id="LODOP" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width="0"
        height="0">
        <embed id="LODOP_EM" type="application/x-print-lodop" width="0" height="0" pluginspage="/Scripts/Printer/install_lodop.exe"></embed>
    </object>
    <script type="text/javascript">
        function tickvalue(id) {
            var iframesrc = document.getElementById("tick").src = "OrderDetails.aspx?id=" + id;
        }
    </script>
    <script type="text/javascript">
        function textboxSelect() {
            var checkbox = document.getElementsByName("cbxSingle");
            var cbxAll = document.getElementById("cbxAll");
            for (var i = 0; i < checkbox.length; i++) {
                if (cbxAll.checked) {
                    checkbox[i].checked = true;
                }
                else {
                    checkbox[i].checked = false;
                }
            }
        }
        function checkCheckboxState() {
            var checkbox = document.getElementsByName("cbxSingle");
            var hiddenId = "";
            var count = 0;
            for (var i = 0; i < checkbox.length; i++) {
                if (checkbox[i].checked == true) {
                    hiddenId += checkbox[i].value + ",";
                    count++;
                }
            }
            if (count == 0) {
                alert('请选择您要操作的订单')
                return false;
            }
            else {
                document.getElementById("<%=HSelectId.ClientID %>").value = hiddenId.substring(0, hiddenId.length - 1);
            }
        }
        var check = function () {
            var dropCompanyName = document.getElementById("dropCompanyName").value;
            if (dropCompanyName == "0") {
                window.alert("请选择商户哦");
                return false;
            }
            return true;
        }
        $(document).ready(function () {
            document.getElementById("btnSearch").onclick = check;
        });
    </script>
    <style type="text/css">
        .onshow
        {
            background: #d6e6f5;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div id="info"></div>
    <div class="main_content fr">
        <div class="gray_bd">
            <div class="table_title">
                商户订单核查表</div>
            <div id="dispArea" runat="server">
                &nbsp;&nbsp;地区：
                <asp:DropDownList ID="ddlarea" runat="server">
                </asp:DropDownList>
            </div>
            <div>
                <table>
                    <tr>
                        <td>
                            商户名称：
                        </td>
                        <td>
                            <asp:DropDownList ID="dropCompanyName" runat="server">
                            </asp:DropDownList>
                        </td>
                        <td>
                            门票类型：
                        </td>
                        <td>
                            <asp:TextBox ID="txtTicketType" runat="server" Width="100px"></asp:TextBox>
                        </td>
                        <td>
                            游玩时间：
                        </td>
                        <td>
                            <asp:TextBox ID="txtStartTime" runat="server" Width="100px" onclick="WdatePicker()"></asp:TextBox>至<asp:TextBox
                                ID="txtEndTime" runat="server" Width="100px" onclick="WdatePicker()"></asp:TextBox>
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;是否注册：
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlIsRegister" runat="server">
                                <asp:ListItem Value="-1">全部</asp:ListItem>
                                <asp:ListItem Value="1">注册用户</asp:ListItem>
                                <asp:ListItem Value="0">非注册用户</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td>
                            &nbsp;团队/散客：
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlIsGroup" runat="server">
                                <asp:ListItem Value="-1">全部</asp:ListItem>
                                <asp:ListItem Value="1">团队</asp:ListItem>
                                <asp:ListItem Value="0">散客</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td>
                            &nbsp;订单号：
                        </td>
                        <td>
                            <asp:TextBox ID="txtKeywords" runat="server" Width="100px"></asp:TextBox>
                        </td>
                        <td>
                            <asp:Button ID="btnSearch" runat="server" Text="搜索" OnClick="btnSearch_Click" />
                        </td>
                    </tr>
                </table>
            </div>
            <div style="margin-left: 5px">
                <asp:Button ID="btnConvertExcel" runat="server" Text="导出Excel" OnClick="btnConvertExcel_Click"
                    OnClientClick="return checkCheckboxState()" />&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:Button ID="btnPrint" runat="server" OnClick="btnPrint_Click" Text="网页打印" OnClientClick="return checkCheckboxState()" />
            &nbsp;如果不能打印请点此<a href="/Scripts/Printer/install_lodop.exe">安装插件</a></div>
            <div class="pad5px">
                <div class="border_b_dotted">
                    <table class="tableliststyle" cellspacing="0" rules="all" border="1">
                        <tr class="gridheader">
                            <th>
                                <input id="cbxAll" type="checkbox" onclick="textboxSelect()" />
                            </th>
                            <th style="width: 40px;">
                                序号
                            </th>
                            <th>
                                订单编号
                            </th>
                            <th>
                                姓名
                            </th>
                            <th>
                                联系电话
                            </th>
                            <th>
                                订票类型
                            </th>
                            <th>
                                团/散
                            </th>
                            <th>
                                预订
                            </th>
                            <th>
                                优惠价
                            </th>
                            <th>
                                游玩日期
                            </th>
                            <th>
                                实到
                            </th>
                        </tr>
                        <asp:Repeater ID="rptUserList" runat="server" OnItemCommand="rptUserList_ItemCommand"
                            OnItemDataBound="rptUserList_ItemDataBound">
                            <ItemTemplate>
                                <tr onmouseover="this.className='onshow'" onmouseout="this.className=''" class="">
                                    <td align="center">
                                        <input id="<%#Eval("ID") %>" type="checkbox" value="<%#Eval("ID") %>" name="cbxSingle"
                                            <%#int.Parse(Eval("ORDER_OUTPUT_PRINT_COUNT").ToString())>0?"":"checked=\"checked\"" %> />
                                    </td>
                                    <td align="center">
                                        <asp:Literal ID="litNum" runat="server"></asp:Literal>
                                    </td>
                                    <td align="center">
                                        <a href="javascript:$('#win').skygqbox();tickvalue('<%#Eval("ID") %>')">
                                            <%#Eval("ORDER_NO")%></a>
                                    </td>
                                    <td align="center">
                                        <%#Eval("BOOK_NAME")%>
                                    </td>
                                    <td align="center">
                                        <%#Eval("BOOK_MOBILE")%>
                                    </td>
                                    <td align="center">
                                        <%#Eval("BOOK_NAME1")%>
                                    </td>
                                    <td align="center">
                                        <%#Convert.ToInt32(Eval("TICKET_COUNT")) >=Convert.ToInt32(Eval("GROUP_MIN_COUNT"))?"团":"散"%>
                                    </td>
                                    <td align="center">
                                        <%#Eval("TICKET_COUNT")%>
                                    </td>
                                    <td align="right">
                                        <%#Eval("BOOK_PRICE","{0:0.00}")%>
                                    </td>
                                    <td align="center">
                                        <%#Eval("VISIT_DATE","{0:yyyy-MM-dd}")%>
                                    </td>
                                    <td>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                    </table>
                </div>
                <div style="text-align: center; display: none">
                    共
                    <asp:Literal ID="lit" runat="server"></asp:Literal>
                    条记录&nbsp;&nbsp;&nbsp;&nbsp; 共
                    <asp:Literal ID="litAllPage" runat="server"></asp:Literal>
                    页&nbsp;&nbsp;&nbsp;&nbsp; 第
                    <asp:Literal ID="litCurrentPage" runat="server"></asp:Literal>
                    页
                    <asp:LinkButton ID="lbtnFirst" runat="server" OnClick="lbtnFirst_Click">首页</asp:LinkButton>&nbsp;
                    <asp:LinkButton ID="lbtnPrev" runat="server" OnClick="lbtnPrev_Click">上一页</asp:LinkButton>&nbsp;
                    <asp:LinkButton ID="lbtnNext" runat="server" OnClick="lbtnNext_Click">下一页</asp:LinkButton>&nbsp;
                    <asp:LinkButton ID="lbtnEnd" runat="server" OnClick="lbtnEnd_Click">末页</asp:LinkButton>
                    跳转到第
                    <asp:TextBox ID="txtPage" runat="server" Width="32px" MaxLength="8" Style="text-align: center"></asp:TextBox>&nbsp;页&nbsp;
                    <asp:Button ID="btnRir" runat="server" Text="确定" OnClick="btnRir_Click" />
                </div>
            </div>
        </div>
        <asp:HiddenField ID="HSelectId" runat="server" />
    </div>
    <div id="win" style="padding: 10px; display: none; width: 740px">
        <iframe id="tick" width="720" height="420" scrolling="auto"></iframe>
    </div>
    <div id="div1" class="report" style="display: none">
        <div class="reportTop">
            <span class="f_right">编号： <strong>
                <%=DateTime.Now.ToString("yyMMdd-HHmmss") %></strong></span>
            <img id="imgLogo" height="35" runat="server" alt="" />
        </div>
        <div class="reportcont" style="width: 710px;">
            <!--信息-->
            <div class="reporttit">
                <h1>
                    <asp:Literal ID="ltlWebSiteName" runat="server"></asp:Literal>（<asp:Literal ID="ltlUrl"
                        runat="server"></asp:Literal>
                    ）—网上订票审核表</h1>
                <p>
                    商户名称：<asp:Literal ID="ltlCompanyName" runat="server"></asp:Literal>
                </p>
            </div>
            <p class="inforep">
                <span class="f_right">商户联系人：<asp:Literal ID="ltlCompanyContact" runat="server"></asp:Literal>&nbsp;&nbsp;<asp:Literal
                    ID="ltlCompanyTel" runat="server"></asp:Literal>
                    传真：<asp:Literal ID="ltlCompanyFax" runat="server"></asp:Literal></span> 网站联系人：<asp:Literal
                        ID="litWebSiteContact" runat="server"></asp:Literal>&nbsp;&nbsp;<asp:Literal ID="litWebSiteTel"
                            runat="server"></asp:Literal>
                传真：<asp:Literal ID="ltlFax" runat="server"></asp:Literal>
            </p>
            <table cellpadding="0" cellspacing="0" class="reportTab" width="710px" style="margin: 0 auto;
                font-size: 12px">
                <thead>
                    <tr>
                        <td colspan="10">
                            <p class="summary">
                                <span>订票数量总数：<strong><asp:Literal ID="ltlOrderSum" runat="server"></asp:Literal></strong></span>
                                <span>订票总价格：<strong><asp:Literal ID="ltlSumPrice" runat="server"></asp:Literal></strong></span>
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            序号
                        </th>
                        <th>
                            订单编号
                        </th>
                        <th>
                            姓名
                        </th>
                        <th>
                            联系电话
                        </th>
                        <th>
                            订票类型
                        </th>
                        <th>
                            团/散
                        </th>
                        <th>
                            预订
                        </th>
                        <th>
                            优惠价
                        </th>
                        <th>
                            游玩日期
                        </th>
                        <th>
                            实到
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <asp:Repeater ID="rptOrderReport" runat="server" OnItemDataBound="rptOrderReport_ItemDataBound">
                        <ItemTemplate>
                            <tr>
                                <td>
                                    <asp:Literal ID="litNum" runat="server"></asp:Literal>
                                </td>
                                <td align="center">
                                    <%#Eval("ORDER_NO")%>
                                </td>
                                <td align="center">
                                    <%#Eval("BOOK_NAME")%>
                                </td>
                                <td align="center">
                                    <%#Eval("BOOK_MOBILE")%>
                                </td>
                                <td align="center">
                                    <%#Eval("BOOK_NAME1")%>
                                </td>
                                <td align="center">
                                    <%#Convert.ToInt32(Eval("TICKET_COUNT")) >=Convert.ToInt32(Eval("GROUP_MIN_COUNT"))?"团":"散"%>
                                </td>
                                <td align="center">
                                    <%#Eval("TICKET_COUNT")%>
                                </td>
                                <td align="right">
                                    <%#Eval("BOOK_PRICE","{0:0.00}")%>
                                </td>
                                <td align="center">
                                    <%#Eval("VISIT_DATE","{0:yyyy-MM-dd}")%>
                                </td>
                                <td>
                                </td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </tbody>
                <tfoot>
                    <tr>
                        <td colspan="10">
                            <p class="summary">
                                <span>订票数量总数：<strong><asp:Literal ID="ltlOrderSum1" runat="server"></asp:Literal></strong></span>
                                <span>订票总价格：<strong><asp:Literal ID="ltlSumPrice1" runat="server"></asp:Literal></strong></span>
                            </p>
                        </td>
                    </tr>
                </tfoot>
            </table>
        </div>
        <div class="reportEnd">
            <p>
                请准确填写"实到"数量，可以有两种方式回传给我们：</p>
            <p>
                1、发送传真，传真号码：<asp:Literal ID="ltlFax1" runat="server"></asp:Literal><span>2、电子邮箱：<asp:Literal
                    ID="ltlEmail" runat="server"></asp:Literal></span></p>
            <p>
                如有疑问，请联系票务专员：<asp:Literal ID="ltlContact" runat="server"></asp:Literal>
                &nbsp;&nbsp;&nbsp;<asp:Literal ID="ltlTel" runat="server"></asp:Literal>
            </p>
        </div>
    </div>
    <div id="divExcel" style="display: none">
        <table width="600" border="1" cellpadding="2" cellspacing="0" id="tab1" style="font-size: 12px;color: Black;">
            <tr>
                <td align="right" colspan="10">
                    编号：<%=DateTime.Now.ToString("yyMMdd-HHmmss") %>
                </td>
            </tr>
            <tr>
                <td colspan="10" align="center" valign="middle">
                    <h3>
                        <strong>
                            <asp:Literal ID="ltlWebSiteNameXls" runat="server"></asp:Literal>（<asp:Literal ID="ltlUrlXls"
                                runat="server"></asp:Literal>
                            ）&mdash;网上订票审核表</strong></h3>
                </td>
            </tr>
            <tr>
                <td colspan="10" align="center" valign="middle">
                    商户名称：<asp:Literal ID="ltlCompanyNameXls" runat="server"></asp:Literal>
                </td>
            </tr>
            <tr>
                <td colspan="5">
                    网站联系人：<asp:Literal ID="litWebSiteContactXls" runat="server"></asp:Literal>
                    <asp:Literal ID="litWebSiteTelXls" runat="server"></asp:Literal>
                    传真：<asp:Literal ID="ltlFaxXls" runat="server"></asp:Literal>
                </td>
                <td colspan="5" align="right" valign="middle">
                    商户联系人：<asp:Literal ID="ltlCompanyContactXls" runat="server"></asp:Literal>
                    <asp:Literal ID="ltlCompanyTelXls" runat="server"></asp:Literal>
                    传真：<asp:Literal ID="ltlCompanyFaxXls" runat="server"></asp:Literal>
                </td>
            </tr>
            <tr>
                <td colspan="10" align="right" valign="middle">
                    订票数量总数：<asp:Literal ID="ltlOrderSumXls" runat="server"></asp:Literal>
                    订票总价格：<asp:Literal ID="ltlSumPriceXls" runat="server"></asp:Literal>
                </td>
            </tr>
            <tr>
                <td align="center" bgcolor="#CDEFFC">
                    <strong>序号</strong>
                </td>
                <td align="center" bgcolor="#CDEFFC">
                    <strong>订单编号</strong>
                </td>
                <td align="center" bgcolor="#CDEFFC">
                    <strong>姓名</strong>
                </td>
                <td align="center" bgcolor="#CDEFFC">
                    <strong>联系电话</strong>
                </td>
                <td align="center" bgcolor="#CDEFFC">
                    <strong>订票类型</strong>
                </td>
                <td align="center" bgcolor="#CDEFFC">
                    <strong>团/散</strong>
                </td>
                <td align="center" bgcolor="#CDEFFC">
                    <strong>预定</strong>
                </td>
                <td align="center" bgcolor="#CDEFFC">
                    <strong>优惠价</strong>
                </td>
                <td align="center" bgcolor="#CDEFFC">
                    <strong>游玩日期</strong>
                </td>
                <td align="center" bgcolor="#CDEFFC">
                    <strong>实到</strong>
                </td>
            </tr>
            <asp:Repeater ID="rptOrderReportXls" runat="server" OnItemDataBound="rptOrderReport_ItemDataBound">
                <ItemTemplate>
                    <tr>
                        <td align="center">
                            <asp:Literal ID="litNum" runat="server"></asp:Literal>
                        </td>
                        <td align="center">
                            <%#Eval("ORDER_NO")%>
                        </td>
                        <td align="center">
                            <%#Eval("BOOK_NAME")%>
                        </td>
                        <td align="center">
                            <%#Eval("BOOK_MOBILE")%>
                        </td>
                        <td align="center">
                            <%#Eval("BOOK_NAME1")%>
                        </td>
                        <td align="center">
                            <%#Convert.ToInt32(Eval("TICKET_COUNT")) >=Convert.ToInt32(Eval("GROUP_MIN_COUNT"))?"团":"散"%>
                        </td>
                        <td align="center">
                            <%#Eval("TICKET_COUNT")%>
                        </td>
                        <td align="right">
                            <%#Eval("BOOK_PRICE","{0:0.00}")%>
                        </td>
                        <td align="center">
                            <%#Eval("VISIT_DATE","{0:yyyy-MM-dd}")%>
                        </td>
                        <td>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
            <tr>
                <td colspan="10" align="right" valign="middle">
                    订票数量总数：<asp:Literal ID="ltlOrderSum1Xls" runat="server"></asp:Literal>订票总价格：<asp:Literal
                        ID="ltlSumPrice1Xls" runat="server"></asp:Literal>
                </td>
            </tr>
            <tr>
                <td colspan="10">
                    请准确填写&ldquo;实到&rdquo;数量，可以有两种方式回传给我们：
                </td>
            </tr>
            <tr>
                <td colspan="10">
                    1、发送传真，传真号码：<asp:Literal ID="ltlFax1Xls" runat="server"></asp:Literal>
                    2、电子邮箱：<asp:Literal ID="ltlEmailXls" runat="server"></asp:Literal>
                </td>
            </tr>
            <tr>
                <td colspan="10">
                    如有疑问，请联系票务专员：<asp:Literal ID="ltlContactXls" runat="server"></asp:Literal>
                    <asp:Literal ID="ltlTelXls" runat="server"></asp:Literal>
                </td>
            </tr>
        </table>
    </div>
    <script language="javascript" type="text/javascript">
        var LODOP; //声明为全局变量
        function PrintMytable() {
            LODOP = getLodop(document.getElementById('LODOP'), document.getElementById('LODOP_EM'));
            LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_打印表格");
            LODOP.ADD_PRINT_TABLE(100, 20, 760, 250, document.getElementById("div1").innerHTML);
            LODOP.PREVIEW();
        };
        function PreviewSameStyle() {
            LODOP = getLodop(document.getElementById('LODOP'), document.getElementById('LODOP_EM'));
            LODOP.ADD_PRINT_TEXT(1020, 570, 244, 22, "第#页/共&页 编号：<%=DateTime.Now.ToString("yyMMdd-HHmmss") %>");
            LODOP.SET_PRINT_STYLEA(1, "ItemType", 2);
            var strBodyStyle = "<style>" + document.getElementById("style1").innerHTML + "</style>";
            var strFormHtml = strBodyStyle + "<body>" + document.getElementById("div1").innerHTML + "</body>";
            LODOP.ADD_PRINT_HTM(10, 30, 600, 1000, strFormHtml);
            LODOP.PREVIEW();
        };
        function OutToFileMoreSheet() {
            LODOP = getLodop(document.getElementById('LODOP'), document.getElementById('LODOP_EM'));
            LODOP.PRINT_INIT("");
            LODOP.ADD_PRINT_TABLE(100, 20, 500, 60, document.getElementById("divExcel").innerHTML);
            if (LODOP.SAVE_TO_FILE("商户订单核查表.xls")) alert("导出成功！");
        };
		
    </script>
    </form>
</body>
</html>
